"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const adminMiddleware_1 = require("./adminMiddleware");
const classroomMiddleware_1 = require("./classroomMiddleware");
const broadcastMiddleware_1 = require("./broadcastMiddleware");
const recording_1 = require("./recording");
const saveDatabase_1 = require("./saveDatabase");
async function middlewares(app, io) {
    const { socket } = app.locals;
    const { userId, username, userType } = socket.handshake.query;
    (0, adminMiddleware_1.adminMiddleware)(app, io);
    (0, classroomMiddleware_1.classroomMiddleware)(app, io);
    (0, broadcastMiddleware_1.broadcastMiddleware)(app, io);
    (0, recording_1.recording)(app, io);
    (0, saveDatabase_1.saveDatabase)(app, io);
    socket.broadcastOnlineToAll({ userId, username, userType });
}
exports.default = middlewares;
